{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from fastai.tabular.all import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Rossmann"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Data preparation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To create the feature-engineered train_clean and test_clean from the Kaggle competition data, run `rossman_data_clean.ipynb`. One important step that deals with time series is this:\n",
    "\n",
    "```python\n",
    "add_datepart(train, \"Date\", drop=False)\n",
    "add_datepart(test, \"Date\", drop=False)\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = Config().data/'rossmann'\n",
    "train_df = pd.read_pickle(path/'train_clean')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Store</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DayOfWeek</th>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <td>2015-07-31 00:00:00</td>\n",
       "      <td>2015-07-31 00:00:00</td>\n",
       "      <td>2015-07-31 00:00:00</td>\n",
       "      <td>2015-07-31 00:00:00</td>\n",
       "      <td>2015-07-31 00:00:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sales</th>\n",
       "      <td>5263</td>\n",
       "      <td>6064</td>\n",
       "      <td>8314</td>\n",
       "      <td>13995</td>\n",
       "      <td>4822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Customers</th>\n",
       "      <td>555</td>\n",
       "      <td>625</td>\n",
       "      <td>821</td>\n",
       "      <td>1498</td>\n",
       "      <td>559</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>StateHoliday_bw</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SchoolHoliday_bw</th>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Promo_fw</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>StateHoliday_fw</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SchoolHoliday_fw</th>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>69 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                    0                    1  \\\n",
       "Store                               1                    2   \n",
       "DayOfWeek                           5                    5   \n",
       "Date              2015-07-31 00:00:00  2015-07-31 00:00:00   \n",
       "Sales                            5263                 6064   \n",
       "Customers                         555                  625   \n",
       "...                               ...                  ...   \n",
       "StateHoliday_bw                     0                    0   \n",
       "SchoolHoliday_bw                    5                    5   \n",
       "Promo_fw                            5                    1   \n",
       "StateHoliday_fw                     0                    0   \n",
       "SchoolHoliday_fw                    7                    1   \n",
       "\n",
       "                                    2                    3  \\\n",
       "Store                               3                    4   \n",
       "DayOfWeek                           5                    5   \n",
       "Date              2015-07-31 00:00:00  2015-07-31 00:00:00   \n",
       "Sales                            8314                13995   \n",
       "Customers                         821                 1498   \n",
       "...                               ...                  ...   \n",
       "StateHoliday_bw                     0                    0   \n",
       "SchoolHoliday_bw                    5                    5   \n",
       "Promo_fw                            5                    1   \n",
       "StateHoliday_fw                     0                    0   \n",
       "SchoolHoliday_fw                    5                    1   \n",
       "\n",
       "                                    4  \n",
       "Store                               5  \n",
       "DayOfWeek                           5  \n",
       "Date              2015-07-31 00:00:00  \n",
       "Sales                            4822  \n",
       "Customers                         559  \n",
       "...                               ...  \n",
       "StateHoliday_bw                     0  \n",
       "SchoolHoliday_bw                    5  \n",
       "Promo_fw                            1  \n",
       "StateHoliday_fw                     0  \n",
       "SchoolHoliday_fw                    1  \n",
       "\n",
       "[69 rows x 5 columns]"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df.head().T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "844338"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n = len(train_df); n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Experimenting with a sample"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "idx = np.random.permutation(range(n))[:2000]\n",
    "idx.sort()\n",
    "small_df = train_df.iloc[idx]\n",
    "small_cont_vars = ['CompetitionDistance', 'Mean_Humidity']\n",
    "small_cat_vars =  ['Store', 'DayOfWeek', 'PromoInterval']\n",
    "small_df = small_df[small_cat_vars + small_cont_vars + ['Sales']].reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>PromoInterval</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>Mean_Humidity</th>\n",
       "      <th>Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>471</td>\n",
       "      <td>5</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "      <td>5300.0</td>\n",
       "      <td>50</td>\n",
       "      <td>9116.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>656</td>\n",
       "      <td>5</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "      <td>410.0</td>\n",
       "      <td>54</td>\n",
       "      <td>4576.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1112</td>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1880.0</td>\n",
       "      <td>61</td>\n",
       "      <td>9626.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>459</td>\n",
       "      <td>4</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "      <td>250.0</td>\n",
       "      <td>86</td>\n",
       "      <td>10847.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1108</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>540.0</td>\n",
       "      <td>51</td>\n",
       "      <td>7187.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Store  DayOfWeek    PromoInterval  CompetitionDistance  Mean_Humidity  \\\n",
       "0    471          5  Feb,May,Aug,Nov               5300.0             50   \n",
       "1    656          5  Jan,Apr,Jul,Oct                410.0             54   \n",
       "2   1112          5              NaN               1880.0             61   \n",
       "3    459          4  Feb,May,Aug,Nov                250.0             86   \n",
       "4   1108          4              NaN                540.0             51   \n",
       "\n",
       "     Sales  \n",
       "0   9116.0  \n",
       "1   4576.0  \n",
       "2   9626.0  \n",
       "3  10847.0  \n",
       "4   7187.0  "
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "small_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>PromoInterval</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>Mean_Humidity</th>\n",
       "      <th>Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1000</th>\n",
       "      <td>75</td>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>22440.0</td>\n",
       "      <td>68</td>\n",
       "      <td>4823.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1001</th>\n",
       "      <td>79</td>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3320.0</td>\n",
       "      <td>68</td>\n",
       "      <td>3968.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1002</th>\n",
       "      <td>390</td>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1600.0</td>\n",
       "      <td>71</td>\n",
       "      <td>9571.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1003</th>\n",
       "      <td>400</td>\n",
       "      <td>3</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "      <td>70.0</td>\n",
       "      <td>73</td>\n",
       "      <td>7629.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1004</th>\n",
       "      <td>825</td>\n",
       "      <td>3</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "      <td>380.0</td>\n",
       "      <td>78</td>\n",
       "      <td>3422.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Store  DayOfWeek    PromoInterval  CompetitionDistance  Mean_Humidity  \\\n",
       "1000     75          3              NaN              22440.0             68   \n",
       "1001     79          3              NaN               3320.0             68   \n",
       "1002    390          3              NaN               1600.0             71   \n",
       "1003    400          3  Jan,Apr,Jul,Oct                 70.0             73   \n",
       "1004    825          3  Jan,Apr,Jul,Oct                380.0             78   \n",
       "\n",
       "       Sales  \n",
       "1000  4823.0  \n",
       "1001  3968.0  \n",
       "1002  9571.0  \n",
       "1003  7629.0  \n",
       "1004  3422.0  "
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "small_df.iloc[1000:].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "splits = [list(range(1000)),list(range(1000,2000))]\n",
    "to = TabularPandas(small_df.copy(), Categorify, cat_names=small_cat_vars, cont_names=small_cont_vars, splits=splits)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>PromoInterval</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>Mean_Humidity</th>\n",
       "      <th>Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>283</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>5300.0</td>\n",
       "      <td>50</td>\n",
       "      <td>9116.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>389</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>410.0</td>\n",
       "      <td>54</td>\n",
       "      <td>4576.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>653</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>1880.0</td>\n",
       "      <td>61</td>\n",
       "      <td>9626.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>272</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>250.0</td>\n",
       "      <td>86</td>\n",
       "      <td>10847.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>649</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>540.0</td>\n",
       "      <td>51</td>\n",
       "      <td>7187.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Store  DayOfWeek  PromoInterval  CompetitionDistance  Mean_Humidity  \\\n",
       "0    283          5              1               5300.0             50   \n",
       "1    389          5              2                410.0             54   \n",
       "2    653          5              0               1880.0             61   \n",
       "3    272          4              1                250.0             86   \n",
       "4    649          4              0                540.0             51   \n",
       "\n",
       "     Sales  \n",
       "0   9116.0  \n",
       "1   4576.0  \n",
       "2   9626.0  \n",
       "3  10847.0  \n",
       "4   7187.0  "
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "to.train.items.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>PromoInterval</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>Mean_Humidity</th>\n",
       "      <th>Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1000</th>\n",
       "      <td>46</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>22440.0</td>\n",
       "      <td>68</td>\n",
       "      <td>4823.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1001</th>\n",
       "      <td>49</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>3320.0</td>\n",
       "      <td>68</td>\n",
       "      <td>3968.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1002</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1600.0</td>\n",
       "      <td>71</td>\n",
       "      <td>9571.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1003</th>\n",
       "      <td>236</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>70.0</td>\n",
       "      <td>73</td>\n",
       "      <td>7629.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1004</th>\n",
       "      <td>492</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>380.0</td>\n",
       "      <td>78</td>\n",
       "      <td>3422.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Store  DayOfWeek  PromoInterval  CompetitionDistance  Mean_Humidity  \\\n",
       "1000     46          3              0              22440.0             68   \n",
       "1001     49          3              0               3320.0             68   \n",
       "1002      0          3              0               1600.0             71   \n",
       "1003    236          3              2                 70.0             73   \n",
       "1004    492          3              2                380.0             78   \n",
       "\n",
       "       Sales  \n",
       "1000  4823.0  \n",
       "1001  3968.0  \n",
       "1002  9571.0  \n",
       "1003  7629.0  \n",
       "1004  3422.0  "
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "to.valid.items.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(#8) [#na#,1,2,3,4,5,6,7]"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "to.classes['DayOfWeek']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "splits = [list(range(1000)),list(range(1000,2000))]\n",
    "to = TabularPandas(small_df.copy(), FillMissing, cat_names=small_cat_vars, cont_names=small_cont_vars, splits=splits)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>PromoInterval</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>Mean_Humidity</th>\n",
       "      <th>Sales</th>\n",
       "      <th>CompetitionDistance_na</th>\n",
       "      <th>Mean_Humidity_na</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>521</th>\n",
       "      <td>291</td>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2380.0</td>\n",
       "      <td>83</td>\n",
       "      <td>7928.0</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Store  DayOfWeek PromoInterval  CompetitionDistance  Mean_Humidity  \\\n",
       "521    291          5           NaN               2380.0             83   \n",
       "\n",
       "      Sales  CompetitionDistance_na  Mean_Humidity_na  \n",
       "521  7928.0                    True             False  "
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "to.train.items[to.train.items['CompetitionDistance_na'] == True]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Preparing full data set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_df = pd.read_pickle(path/'train_clean')\n",
    "test_df = pd.read_pickle(path/'test_clean')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(844338, 41088)"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(train_df),len(test_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "procs=[FillMissing, Categorify, Normalize]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dep_var = 'Sales'\n",
    "cat_names = ['Store', 'DayOfWeek', 'Year', 'Month', 'Day', 'StateHoliday', 'StoreType', 'Assortment', \n",
    "    'PromoInterval', 'CompetitionOpenSinceYear', 'Promo2SinceYear', 'State', 'Week', 'Events', 'Promo_fw', \n",
    "    'Promo_bw', 'StateHoliday_fw', 'StateHoliday_bw', 'SchoolHoliday_fw', 'SchoolHoliday_bw']\n",
    "\n",
    "cont_names = ['CompetitionDistance', 'Max_TemperatureC', 'Mean_TemperatureC', 'Min_TemperatureC', \n",
    "    'Max_Humidity', 'Mean_Humidity', 'Min_Humidity', 'Max_Wind_SpeedKm_h', 'Mean_Wind_SpeedKm_h', \n",
    "    'CloudCover', 'trend', 'trend_DE', 'AfterStateHoliday', 'BeforeStateHoliday', 'Promo', 'SchoolHoliday']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dep_var = 'Sales'\n",
    "df = train_df[cat_names + cont_names + [dep_var,'Date']].copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(Timestamp('2015-08-01 00:00:00'), Timestamp('2015-09-17 00:00:00'))"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_df['Date'].min(), test_df['Date'].max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "41254"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cut = train_df['Date'][(train_df['Date'] == train_df['Date'][len(test_df)])].index.max()\n",
    "cut"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "splits = (list(range(cut, len(train_df))),list(range(cut)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     5263.0\n",
       "1     6064.0\n",
       "2     8314.0\n",
       "3    13995.0\n",
       "4     4822.0\n",
       "Name: Sales, dtype: float64"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df[dep_var].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_df[dep_var] = np.log(train_df[dep_var])\n",
    "#train_df = train_df.iloc[:100000]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#cut = 20000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "splits = (list(range(cut, len(train_df))),list(range(cut)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 3min 57s, sys: 59.2 s, total: 4min 56s\n",
      "Wall time: 44.8 s\n"
     ]
    }
   ],
   "source": [
    "%time to = TabularPandas(train_df, procs, cat_names, cont_names, dep_var, y_block=TransformBlock(), splits=splits)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dls = to.dataloaders(bs=512, path=path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Store</th>\n",
       "      <th>DayOfWeek</th>\n",
       "      <th>Year</th>\n",
       "      <th>Month</th>\n",
       "      <th>Day</th>\n",
       "      <th>StateHoliday</th>\n",
       "      <th>StoreType</th>\n",
       "      <th>Assortment</th>\n",
       "      <th>PromoInterval</th>\n",
       "      <th>CompetitionOpenSinceYear</th>\n",
       "      <th>Promo2SinceYear</th>\n",
       "      <th>State</th>\n",
       "      <th>Week</th>\n",
       "      <th>Events</th>\n",
       "      <th>Promo_fw</th>\n",
       "      <th>Promo_bw</th>\n",
       "      <th>StateHoliday_fw</th>\n",
       "      <th>StateHoliday_bw</th>\n",
       "      <th>SchoolHoliday_fw</th>\n",
       "      <th>SchoolHoliday_bw</th>\n",
       "      <th>CompetitionDistance_na</th>\n",
       "      <th>Max_TemperatureC_na</th>\n",
       "      <th>Mean_TemperatureC_na</th>\n",
       "      <th>Min_TemperatureC_na</th>\n",
       "      <th>Max_Humidity_na</th>\n",
       "      <th>Mean_Humidity_na</th>\n",
       "      <th>Min_Humidity_na</th>\n",
       "      <th>Max_Wind_SpeedKm_h_na</th>\n",
       "      <th>Mean_Wind_SpeedKm_h_na</th>\n",
       "      <th>CloudCover_na</th>\n",
       "      <th>trend_na</th>\n",
       "      <th>trend_DE_na</th>\n",
       "      <th>AfterStateHoliday_na</th>\n",
       "      <th>BeforeStateHoliday_na</th>\n",
       "      <th>Promo_na</th>\n",
       "      <th>SchoolHoliday_na</th>\n",
       "      <th>CompetitionDistance</th>\n",
       "      <th>Max_TemperatureC</th>\n",
       "      <th>Mean_TemperatureC</th>\n",
       "      <th>Min_TemperatureC</th>\n",
       "      <th>Max_Humidity</th>\n",
       "      <th>Mean_Humidity</th>\n",
       "      <th>Min_Humidity</th>\n",
       "      <th>Max_Wind_SpeedKm_h</th>\n",
       "      <th>Mean_Wind_SpeedKm_h</th>\n",
       "      <th>CloudCover</th>\n",
       "      <th>trend</th>\n",
       "      <th>trend_DE</th>\n",
       "      <th>AfterStateHoliday</th>\n",
       "      <th>BeforeStateHoliday</th>\n",
       "      <th>Promo</th>\n",
       "      <th>SchoolHoliday</th>\n",
       "      <th>Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>90</td>\n",
       "      <td>6</td>\n",
       "      <td>2013</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>False</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>#na#</td>\n",
       "      <td>2007</td>\n",
       "      <td>#na#</td>\n",
       "      <td>NW</td>\n",
       "      <td>19</td>\n",
       "      <td>Rain</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>329.999926</td>\n",
       "      <td>16.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>7.000000e+00</td>\n",
       "      <td>93.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>48.000000</td>\n",
       "      <td>37.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>60.0</td>\n",
       "      <td>1.999998</td>\n",
       "      <td>-9.000000</td>\n",
       "      <td>1.436922e-08</td>\n",
       "      <td>1.656771e-09</td>\n",
       "      <td>8.963928</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>852</td>\n",
       "      <td>4</td>\n",
       "      <td>2013</td>\n",
       "      <td>3</td>\n",
       "      <td>14</td>\n",
       "      <td>False</td>\n",
       "      <td>c</td>\n",
       "      <td>a</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "      <td>2004</td>\n",
       "      <td>2011</td>\n",
       "      <td>HE</td>\n",
       "      <td>11</td>\n",
       "      <td>Snow</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>940.000185</td>\n",
       "      <td>2.0</td>\n",
       "      <td>-4.0</td>\n",
       "      <td>-1.100000e+01</td>\n",
       "      <td>93.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>51.000000</td>\n",
       "      <td>21.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>70.000000</td>\n",
       "      <td>62.0</td>\n",
       "      <td>71.999998</td>\n",
       "      <td>-15.000000</td>\n",
       "      <td>1.436922e-08</td>\n",
       "      <td>1.656771e-09</td>\n",
       "      <td>8.379310</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>189</td>\n",
       "      <td>3</td>\n",
       "      <td>2014</td>\n",
       "      <td>9</td>\n",
       "      <td>24</td>\n",
       "      <td>False</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>#na#</td>\n",
       "      <td>2014</td>\n",
       "      <td>#na#</td>\n",
       "      <td>RP</td>\n",
       "      <td>39</td>\n",
       "      <td>Rain</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>5760.000013</td>\n",
       "      <td>16.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>6.000000e+00</td>\n",
       "      <td>97.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>59.000000</td>\n",
       "      <td>11.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>63.000000</td>\n",
       "      <td>72.0</td>\n",
       "      <td>96.999998</td>\n",
       "      <td>-9.000000</td>\n",
       "      <td>1.436922e-08</td>\n",
       "      <td>1.656771e-09</td>\n",
       "      <td>8.744328</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>615</td>\n",
       "      <td>2</td>\n",
       "      <td>2014</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>False</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>#na#</td>\n",
       "      <td>2007</td>\n",
       "      <td>#na#</td>\n",
       "      <td>HE</td>\n",
       "      <td>10</td>\n",
       "      <td>#na#</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>729.999814</td>\n",
       "      <td>13.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>4.409999e-08</td>\n",
       "      <td>100.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>28.999999</td>\n",
       "      <td>13.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>50.000000</td>\n",
       "      <td>55.0</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>-45.000000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.656771e-09</td>\n",
       "      <td>9.527994</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>525</td>\n",
       "      <td>3</td>\n",
       "      <td>2013</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>False</td>\n",
       "      <td>d</td>\n",
       "      <td>c</td>\n",
       "      <td>#na#</td>\n",
       "      <td>2013</td>\n",
       "      <td>#na#</td>\n",
       "      <td>BE</td>\n",
       "      <td>6</td>\n",
       "      <td>#na#</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>1869.999936</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>-3.000000e+00</td>\n",
       "      <td>93.0</td>\n",
       "      <td>73.0</td>\n",
       "      <td>48.000000</td>\n",
       "      <td>24.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>55.000000</td>\n",
       "      <td>51.0</td>\n",
       "      <td>36.000000</td>\n",
       "      <td>-51.000000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>9.314791</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>671</td>\n",
       "      <td>2</td>\n",
       "      <td>2013</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>False</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>Jan,Apr,Jul,Oct</td>\n",
       "      <td>2008</td>\n",
       "      <td>2010</td>\n",
       "      <td>BY</td>\n",
       "      <td>40</td>\n",
       "      <td>#na#</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>2070.000112</td>\n",
       "      <td>11.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>8.000000e+00</td>\n",
       "      <td>93.0</td>\n",
       "      <td>84.0</td>\n",
       "      <td>71.000000</td>\n",
       "      <td>13.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>57.000000</td>\n",
       "      <td>62.0</td>\n",
       "      <td>47.000000</td>\n",
       "      <td>-1.999999</td>\n",
       "      <td>1.436922e-08</td>\n",
       "      <td>1.656771e-09</td>\n",
       "      <td>8.411611</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>243</td>\n",
       "      <td>4</td>\n",
       "      <td>2015</td>\n",
       "      <td>3</td>\n",
       "      <td>12</td>\n",
       "      <td>False</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "      <td>#na#</td>\n",
       "      <td>2013</td>\n",
       "      <td>BY</td>\n",
       "      <td>11</td>\n",
       "      <td>Snow</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>310.000001</td>\n",
       "      <td>8.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.409999e-08</td>\n",
       "      <td>87.0</td>\n",
       "      <td>71.0</td>\n",
       "      <td>49.000000</td>\n",
       "      <td>14.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>65.000000</td>\n",
       "      <td>74.0</td>\n",
       "      <td>65.000000</td>\n",
       "      <td>-21.999999</td>\n",
       "      <td>1.436922e-08</td>\n",
       "      <td>1.656771e-09</td>\n",
       "      <td>8.549273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>800</td>\n",
       "      <td>2</td>\n",
       "      <td>2013</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>False</td>\n",
       "      <td>d</td>\n",
       "      <td>a</td>\n",
       "      <td>#na#</td>\n",
       "      <td>2014</td>\n",
       "      <td>#na#</td>\n",
       "      <td>RP</td>\n",
       "      <td>37</td>\n",
       "      <td>Rain</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>2020.000068</td>\n",
       "      <td>17.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>1.200000e+01</td>\n",
       "      <td>89.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>41.000000</td>\n",
       "      <td>24.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>37.999999</td>\n",
       "      <td>51.0</td>\n",
       "      <td>103.000001</td>\n",
       "      <td>-23.000000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.656771e-09</td>\n",
       "      <td>8.782169</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>253</td>\n",
       "      <td>1</td>\n",
       "      <td>2013</td>\n",
       "      <td>6</td>\n",
       "      <td>10</td>\n",
       "      <td>False</td>\n",
       "      <td>a</td>\n",
       "      <td>c</td>\n",
       "      <td>Feb,May,Aug,Nov</td>\n",
       "      <td>#na#</td>\n",
       "      <td>2013</td>\n",
       "      <td>NW</td>\n",
       "      <td>24</td>\n",
       "      <td>#na#</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>250.000227</td>\n",
       "      <td>19.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>1.100000e+01</td>\n",
       "      <td>82.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>39.000000</td>\n",
       "      <td>19.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>69.000000</td>\n",
       "      <td>67.0</td>\n",
       "      <td>11.000001</td>\n",
       "      <td>-115.000003</td>\n",
       "      <td>1.436922e-08</td>\n",
       "      <td>1.656771e-09</td>\n",
       "      <td>8.610683</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1053</td>\n",
       "      <td>3</td>\n",
       "      <td>2014</td>\n",
       "      <td>8</td>\n",
       "      <td>27</td>\n",
       "      <td>False</td>\n",
       "      <td>a</td>\n",
       "      <td>a</td>\n",
       "      <td>#na#</td>\n",
       "      <td>2015</td>\n",
       "      <td>#na#</td>\n",
       "      <td>HB,NI</td>\n",
       "      <td>35</td>\n",
       "      <td>Fog</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>1710.000074</td>\n",
       "      <td>21.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>6.000000e+00</td>\n",
       "      <td>100.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>37.000000</td>\n",
       "      <td>14.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>77.0</td>\n",
       "      <td>79.000001</td>\n",
       "      <td>-37.000000</td>\n",
       "      <td>1.436922e-08</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>8.795733</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dls.show_batch()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "max_log_y = np.log(1.2) + np.max(train_df['Sales'])\n",
    "y_range = (0, max_log_y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dls.c = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "learn = tabular_learner(dls, layers=[1000,500], loss_func=MSELossFlat(),\n",
    "                        config=tabular_config(ps=[0.001,0.01], embed_p=0.04, y_range=y_range), \n",
    "                        metrics=exp_rmspe)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "TabularModel(\n",
       "  (embeds): ModuleList(\n",
       "    (0): Embedding(1116, 81)\n",
       "    (1): Embedding(8, 5)\n",
       "    (2): Embedding(4, 3)\n",
       "    (3): Embedding(13, 7)\n",
       "    (4): Embedding(32, 11)\n",
       "    (5): Embedding(3, 3)\n",
       "    (6): Embedding(5, 4)\n",
       "    (7): Embedding(4, 3)\n",
       "    (8): Embedding(4, 3)\n",
       "    (9): Embedding(24, 9)\n",
       "    (10): Embedding(8, 5)\n",
       "    (11): Embedding(13, 7)\n",
       "    (12): Embedding(53, 15)\n",
       "    (13): Embedding(22, 9)\n",
       "    (14): Embedding(7, 5)\n",
       "    (15): Embedding(7, 5)\n",
       "    (16): Embedding(4, 3)\n",
       "    (17): Embedding(4, 3)\n",
       "    (18): Embedding(9, 5)\n",
       "    (19): Embedding(9, 5)\n",
       "    (20): Embedding(3, 3)\n",
       "    (21): Embedding(2, 2)\n",
       "    (22): Embedding(2, 2)\n",
       "    (23): Embedding(2, 2)\n",
       "    (24): Embedding(2, 2)\n",
       "    (25): Embedding(2, 2)\n",
       "    (26): Embedding(2, 2)\n",
       "    (27): Embedding(2, 2)\n",
       "    (28): Embedding(2, 2)\n",
       "    (29): Embedding(3, 3)\n",
       "    (30): Embedding(2, 2)\n",
       "    (31): Embedding(2, 2)\n",
       "    (32): Embedding(2, 2)\n",
       "    (33): Embedding(2, 2)\n",
       "    (34): Embedding(2, 2)\n",
       "    (35): Embedding(2, 2)\n",
       "  )\n",
       "  (emb_drop): Dropout(p=0.04, inplace=False)\n",
       "  (bn_cont): BatchNorm1d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "  (layers): Sequential(\n",
       "    (0): LinBnDrop(\n",
       "      (0): BatchNorm1d(241, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (1): Dropout(p=0.001, inplace=False)\n",
       "      (2): Linear(in_features=241, out_features=1000, bias=False)\n",
       "      (3): ReLU(inplace=True)\n",
       "    )\n",
       "    (1): LinBnDrop(\n",
       "      (0): BatchNorm1d(1000, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (1): Dropout(p=0.01, inplace=False)\n",
       "      (2): Linear(in_features=1000, out_features=500, bias=False)\n",
       "      (3): ReLU(inplace=True)\n",
       "    )\n",
       "    (2): LinBnDrop(\n",
       "      (0): Linear(in_features=500, out_features=1, bias=True)\n",
       "    )\n",
       "  )\n",
       ")"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "learn.model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(dls.train_ds.cont_names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEKCAYAAAAVaT4rAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deXhU9b3H8fd3MtlXAkkgCRB2RFCQgIDF4u5tva61iktFrVS716e9bW+fLre91V5rb6u1LoiK91as1qXurdYrriCr7JvsYU3YspA9v/vHjBpjCEmYmTOT+byeZ57MnMzM+XCAzzlz5pzfMeccIiISP3xeBxARkchS8YuIxBkVv4hInFHxi4jEGRW/iEicUfGLiMQZv9cBOqNPnz6upKTE6xgiIjFlyZIlFc65vLbTY6L4S0pKWLx4sdcxRERiiplta2+6dvWIiMQZFb+ISJwJW/Gb2cNmts/MVrXzu++bmTOzPuGav4iItC+cW/xzgPPbTjSz/sA5wPYwzltERI4ibMXvnHsLONDOr34P/Bug0eFERDwQ0X38ZnYhsNM5tzyS8xURkU9ErPjNLA34CfCzTj5/ppktNrPF5eXlIc2yv7qeBZv3U9vQHNL3FRGJBZE8jn8IMAhYbmYAxcBSM5vonNvT9snOuVnALIDS0tJu7Rb6v3V7Wbb9EHWNzdQ1tnDwSAMryg6z/cARAPrnpnLbJWOYOuwz5zeIiPRYESt+59xKIP+jx2a2FSh1zlWEa57z1pfzvwu2keJPICXRR0aKn9GF2Vx96gD6Zqdw1z83cu1DC7l0XBE//sIJ5GUmhyuKiEjUsHBdgcvMHgemAX2AvcDPnXMPtfr9VjpZ/KWlpa47Z+42tzh8BsFPGJ9R19jMn974kPvmbcJnxgUn92PGlBJOKs7p8rxERKKNmS1xzpV+ZnosXHqxu8XfWZvLq5nz3laeXlJGTUMzxb1SyU1PIjPFT3ZqIn0yksnLSKZPZjLZqYlkpvjJSPaTm55EbnoSGcn+o65c2nLOUVHdwKbyag7X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aemS0L/hwRnD7DzP5qZi8Ar1rgamLzLHAlrHVm9lhwSGKC00uD96stcGW05Wa2wMwKgtOHBB8vMrNfdvJTyXwCoztiZhlm9rqZLTWzlWZ2UfA5vwGGBD8l/Db43B8E57PCzP4jhItR4oCKX3qSu4DfO+cmAJcBs4PT1wGnO+fGAT8Dbmv1msnAdc65M4OPxwHfJTB+/2DgtHbmkw4scM6dTGC47Jtazf+u4PyPOUiXmSUAZ/HJuC51wCXOuVOAM4DfBVc8PwI2OefGOud+YIHLHw4jMA78WGC8mZ1+rPmJfKSnDcss8e1sYFRwIx0gy8wygWzgUTMbRmBo38RWr3nNOXeg1eOFzrkyADP7ACgB3mkznwYCV34CWAKcE7w/Gbg4eH8ucOdRcqa2eu8lwGvB6QbcFizxFgKfBAraef25wduy4OMMAiuCSF2zQWKcil96Eh8w2TlX23qimf0ReMM5d0lwf/m8Vr+uafMe9a3uN9P+/5FG98mXY0d7TkdqnXNjzSybwArkGwTGu78ayAPGO+cazWwrgWsZt2XA7c65B7o4XxFAu3qkZ3kV+OZHD8xsbPBuNrAzeH9GGOe/gMAuJggMzdsh59xh4NvA980skUDOfcHSPwMYGHxqFZDZ6qX/AG4ws4++IC4ys/wQ/RkkDqj4JValmVlZq9utBEq0NPiF5xo+uSLTHcDtZvYugQtjh8t3gVvNbCHQDzh8rBc455YRuDj3lcBjBPIvJrD1vy74nP3Au8HDP3/rnHuVwK6k+Wa2EniKT68YRDqkwzlFQsTM0gjsxnFmdiUw3Tl30bFeJxJp2scvEjrjCVxc24BDwA0e5xFpl7b4RUTijPbxi4jEGRW/iEicUfGLiMQZFb+ISJxR8YuIxBkVv4hInPl/uEQNNWTX6GoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.lr_find()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: left;\">\n",
       "      <th>epoch</th>\n",
       "      <th>train_loss</th>\n",
       "      <th>valid_loss</th>\n",
       "      <th>_exp_rmspe</th>\n",
       "      <th>time</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>0.027484</td>\n",
       "      <td>0.028010</td>\n",
       "      <td>0.159123</td>\n",
       "      <td>01:16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>0.015487</td>\n",
       "      <td>0.018240</td>\n",
       "      <td>0.141216</td>\n",
       "      <td>01:16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>0.011581</td>\n",
       "      <td>0.015734</td>\n",
       "      <td>0.123025</td>\n",
       "      <td>01:16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>0.008431</td>\n",
       "      <td>0.012607</td>\n",
       "      <td>0.112609</td>\n",
       "      <td>01:16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>0.007278</td>\n",
       "      <td>0.011724</td>\n",
       "      <td>0.108596</td>\n",
       "      <td>01:16</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.fit_one_cycle(5, 3e-3, wd=0.2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "(10th place in the competition was 0.108)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAD4CAYAAAAD6PrjAAAABHNCSVQICAgIfAhkiAAAAAlwSFl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gA/M23btKqRAPb3OpKcAc89hj26u1PgK8CBwCjmF8NzdQB9/lhhYUKqOclOkqyt1KKRUKfAncp7XOrKqqk7I6bbfWukRr3QvjL/B+QNcq3rte26uUugw4qbXeYF9cxXvX+7+vaZDWujcwBrhbKTWkirqe0GZfjFu3b2mtzwdyMG6/VMYT2ox5//1y4Ivqqjopq9P2muMbEzBu+bQEQjC+H5W9f621uaEFhRNKqRYA5s+TZnkK0NquXhxwtIpyt1FK+WEEhE+01vO9pd1a63RgFcY91killK+T97a1yzwfAZyuw/YOAi5XSiUDczFuIf3Hg9sLgNb6qPnzJPAVRvD15O9ECpCitV5rPp+HESQ8uc1g/FLdqLU+YT735PaOAA5orVO11kXAfOBC6uC73NCCwgKgdEbADRj37EvL/2TOKhgAZJjdxaXApUqpJmZkvtQscwullALeA3ZqrV/y9HYrpWKVUpHmcRDGF3UnsBKYXEl7Sz/HZGCFNm5kLgCmmDMkEoCOwO+13V6t9aNa6zitdTzGbYIVWutpntpeAKVUiFIqrPQY47/ldjz0OwGgtT4OHFZKdTaLhgN/eHKbTddSduuotF2e2t5DwAClVLD5e6P039j932V3Duq484HxH/cYUIQRDW/BuIe2HNhr/owy6yrgDYz74duAvnbXuRlIMh83ubnNgzG6bluBzeZjrKe2G0gENpnt3Q78wyxvZ36xkjC64gFmeaD5PMk8387uWo+bn2M3MKYOvh9DKZt95LHtNdu2xXzsAB43yz3yO2H3Xr2A9eZ342uM2Tge22aMiRJpQIRdmce213yvp4Bd5v97H2HMIHL7d1nSXAghhLBpaLePhBBC1IAEBSGEEDYSFIQQQthIUBBCCGEjQUEIIYSNBAUhhBA2EhSEEELY/D9MwzlfAMpihgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.recorder.plot_loss(skip_start=1000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "(10th place in the competition was 0.108)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Inference on the test set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_to = to.new(test_df)\n",
    "test_to.process()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_dls = test_to.dataloaders(bs=512, path=path, shuffle_train=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "learn.metrics=[]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "tst_preds,_ = learn.get_preds(dl=test_dls.train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1, 41088)"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.exp(tst_preds.numpy()).T.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_df[\"Sales\"]=np.exp(tst_preds.numpy()).T[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_df[[\"Id\",\"Sales\"]] = test_df[[\"Id\",\"Sales\"]].astype(\"int\")\n",
    "test_df[[\"Id\",\"Sales\"]].to_csv(\"rossmann_submission.csv\",index=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This submission scored 3rd on the private leaderboard."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "jupytext": {
   "split_at_heading": true
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
